using HKB.Common;
using System;
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using System.Diagnostics;
namespace HKB.Data.Dal.H_AnnounceTableAdapters
{
	[GeneratedCode("System.Data.Design.TypedDataSetGenerator", "2.0.0.0"), DataObject(true), HelpKeyword("vs.data.TableAdapter"), Designer("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"), DesignerCategory("code"), ToolboxItem(true)]
	public class HL_AnnounceTableAdapter : Component
	{
		private SqlDataAdapter _adapter;
		private SqlConnection _connection;
		private SqlCommand[] _commandCollection;
		private bool _clearBeforeFill;
		[System.Diagnostics.DebuggerNonUserCode]
		private SqlDataAdapter Adapter
		{
			get
			{
				if (this._adapter == null)
				{
					this.InitAdapter();
				}
				return this._adapter;
			}
		}
		[System.Diagnostics.DebuggerNonUserCode]
		internal SqlConnection Connection
		{
			get
			{
				if (this._connection == null)
				{
					this.InitConnection();
				}
				return this._connection;
			}
			set
			{
				this._connection = value;
				if (this.Adapter.InsertCommand != null)
				{
					this.Adapter.InsertCommand.Connection = value;
				}
				if (this.Adapter.DeleteCommand != null)
				{
					this.Adapter.DeleteCommand.Connection = value;
				}
				if (this.Adapter.UpdateCommand != null)
				{
					this.Adapter.UpdateCommand.Connection = value;
				}
				for (int i = 0; i < this.CommandCollection.Length; i++)
				{
					if (this.CommandCollection[i] != null)
					{
						this.CommandCollection[i].Connection = value;
					}
				}
			}
		}
		[System.Diagnostics.DebuggerNonUserCode]
		protected SqlCommand[] CommandCollection
		{
			get
			{
				if (this._commandCollection == null)
				{
					this.InitCommandCollection();
				}
				return this._commandCollection;
			}
		}
		[System.Diagnostics.DebuggerNonUserCode]
		public bool ClearBeforeFill
		{
			get
			{
				return this._clearBeforeFill;
			}
			set
			{
				this._clearBeforeFill = value;
			}
		}
		[System.Diagnostics.DebuggerNonUserCode]
		public HL_AnnounceTableAdapter()
		{
			this.ClearBeforeFill = true;
		}
		[System.Diagnostics.DebuggerNonUserCode]
		private void InitAdapter()
		{
			this._adapter = new SqlDataAdapter();
			DataTableMapping dataTableMapping = new DataTableMapping();
			dataTableMapping.SourceTable = "Table";
			dataTableMapping.DataSetTable = "HL_Announce";
			dataTableMapping.ColumnMappings.Add("AnnounceTitle", "AnnounceTitle");
			dataTableMapping.ColumnMappings.Add("AnnounceID", "AnnounceID");
			dataTableMapping.ColumnMappings.Add("AnnounceType", "AnnounceType");
			dataTableMapping.ColumnMappings.Add("AnnounceImportant", "AnnounceImportant");
			dataTableMapping.ColumnMappings.Add("AnnounceContent", "AnnounceContent");
			dataTableMapping.ColumnMappings.Add("AnnounceOwner", "AnnounceOwner");
			dataTableMapping.ColumnMappings.Add("AnnounceBegin", "AnnounceBegin");
			dataTableMapping.ColumnMappings.Add("AnnounceEnd", "AnnounceEnd");
			dataTableMapping.ColumnMappings.Add("AnnounceReadCount", "AnnounceReadCount");
			this._adapter.TableMappings.Add(dataTableMapping);
			this._adapter.DeleteCommand = new SqlCommand();
			this._adapter.DeleteCommand.Connection = this.Connection;
			this._adapter.DeleteCommand.CommandText = "DELETE FROM [HL_Announce] WHERE (([AnnounceID] = @Original_AnnounceID))";
			this._adapter.DeleteCommand.CommandType = CommandType.Text;
			this._adapter.DeleteCommand.Parameters.Add(new SqlParameter("@Original_AnnounceID", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "AnnounceID", DataRowVersion.Original, false, null, "", "", ""));
			this._adapter.InsertCommand = new SqlCommand();
			this._adapter.InsertCommand.Connection = this.Connection;
			this._adapter.InsertCommand.CommandText = "INSERT INTO [HL_Announce] ([AnnounceTitle], [AnnounceType], [AnnounceImportant], [AnnounceContent], [AnnounceOwner], [AnnounceBegin], [AnnounceEnd], [AnnounceReadCount]) VALUES (@AnnounceTitle, @AnnounceType, @AnnounceImportant, @AnnounceContent, @AnnounceOwner, @AnnounceBegin, @AnnounceEnd, @AnnounceReadCount)";
			this._adapter.InsertCommand.CommandType = CommandType.Text;
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@AnnounceTitle", SqlDbType.VarChar, 0, ParameterDirection.Input, 0, 0, "AnnounceTitle", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@AnnounceType", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "AnnounceType", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@AnnounceImportant", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "AnnounceImportant", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@AnnounceContent", SqlDbType.Text, 0, ParameterDirection.Input, 0, 0, "AnnounceContent", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@AnnounceOwner", SqlDbType.VarChar, 0, ParameterDirection.Input, 0, 0, "AnnounceOwner", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@AnnounceBegin", SqlDbType.DateTime, 0, ParameterDirection.Input, 0, 0, "AnnounceBegin", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@AnnounceEnd", SqlDbType.DateTime, 0, ParameterDirection.Input, 0, 0, "AnnounceEnd", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@AnnounceReadCount", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "AnnounceReadCount", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand = new SqlCommand();
			this._adapter.UpdateCommand.Connection = this.Connection;
			this._adapter.UpdateCommand.CommandText = "UPDATE [HL_Announce] SET [AnnounceTitle] = @AnnounceTitle, [AnnounceType] = @AnnounceType, [AnnounceImportant] = @AnnounceImportant, [AnnounceContent] = @AnnounceContent, [AnnounceOwner] = @AnnounceOwner, [AnnounceBegin] = @AnnounceBegin, [AnnounceEnd] = @AnnounceEnd, [AnnounceReadCount] = @AnnounceReadCount WHERE (([AnnounceID] = @Original_AnnounceID))";
			this._adapter.UpdateCommand.CommandType = CommandType.Text;
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@AnnounceTitle", SqlDbType.VarChar, 0, ParameterDirection.Input, 0, 0, "AnnounceTitle", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@AnnounceType", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "AnnounceType", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@AnnounceImportant", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "AnnounceImportant", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@AnnounceContent", SqlDbType.Text, 0, ParameterDirection.Input, 0, 0, "AnnounceContent", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@AnnounceOwner", SqlDbType.VarChar, 0, ParameterDirection.Input, 0, 0, "AnnounceOwner", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@AnnounceBegin", SqlDbType.DateTime, 0, ParameterDirection.Input, 0, 0, "AnnounceBegin", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@AnnounceEnd", SqlDbType.DateTime, 0, ParameterDirection.Input, 0, 0, "AnnounceEnd", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@AnnounceReadCount", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "AnnounceReadCount", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@Original_AnnounceID", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "AnnounceID", DataRowVersion.Original, false, null, "", "", ""));
		}
		[System.Diagnostics.DebuggerNonUserCode]
		private void InitConnection()
		{
			this._connection = new SqlConnection();
			this._connection.ConnectionString = Conn.CurrenConnectionStrings;
		}
		[System.Diagnostics.DebuggerNonUserCode]
		private void InitCommandCollection()
		{
			this._commandCollection = new SqlCommand[7];
			this._commandCollection[0] = new SqlCommand();
			this._commandCollection[0].Connection = this.Connection;
			this._commandCollection[0].CommandText = "SELECT AnnounceTitle, AnnounceID, AnnounceType, AnnounceImportant, AnnounceContent, \r\n      AnnounceOwner, AnnounceBegin, AnnounceEnd,AnnounceReadCount\r\nFROM HL_Announce  order by AnnounceImportant ,AnnounceBegin DESC";
			this._commandCollection[0].CommandType = CommandType.Text;
			this._commandCollection[1] = new SqlCommand();
			this._commandCollection[1].Connection = this.Connection;
			this._commandCollection[1].CommandText = "DELETE FROM [HL_Announce] WHERE (([AnnounceID] = @AnnounceID))";
			this._commandCollection[1].CommandType = CommandType.Text;
			this._commandCollection[1].Parameters.Add(new SqlParameter("@AnnounceID", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "AnnounceID", DataRowVersion.Original, false, null, "", "", ""));
			this._commandCollection[2] = new SqlCommand();
			this._commandCollection[2].Connection = this.Connection;
			this._commandCollection[2].CommandText = "select top 10 AnnounceID,AnnounceTitle,AnnounceType,AnnounceImportant,AnnounceOwner,AnnounceBegin,AnnounceEnd,AnnounceReadCount \r\nFrom HL_Announce where (AnnounceBegin<=GetDate() and AnnounceEnd>=GetDate()) \r\norder By AnnounceImportant desc, AnnounceEnd asc,AnnounceBegin desc";
			this._commandCollection[2].CommandType = CommandType.Text;
			this._commandCollection[3] = new SqlCommand();
			this._commandCollection[3].Connection = this.Connection;
			this._commandCollection[3].CommandText = "select AnnounceID,AnnounceTitle,AnnounceType,AnnounceImportant,AnnounceOwner,AnnounceBegin,AnnounceEnd,AnnounceReadCount \r\nFrom HL_Announce where (AnnounceBegin<=GetDate() and AnnounceEnd>=GetDate()) \r\norder By AnnounceImportant desc, AnnounceEnd asc,AnnounceBegin desc";
			this._commandCollection[3].CommandType = CommandType.Text;
			this._commandCollection[4] = new SqlCommand();
			this._commandCollection[4].Connection = this.Connection;
			this._commandCollection[4].CommandText = "SELECT AnnounceBegin, AnnounceContent, AnnounceEnd, AnnounceID, AnnounceImportant, \r\n      AnnounceOwner, AnnounceTitle, AnnounceType, AnnounceReadCount\r\nFROM HL_Announce\r\nWHERE (AnnounceID = @AnnounceID)";
			this._commandCollection[4].CommandType = CommandType.Text;
			this._commandCollection[4].Parameters.Add(new SqlParameter("@AnnounceID", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "AnnounceID", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[5] = new SqlCommand();
			this._commandCollection[5].Connection = this.Connection;
			this._commandCollection[5].CommandText = "INSERT INTO [HL_Announce] ([AnnounceTitle], [AnnounceType], [AnnounceImportant], [AnnounceContent], [AnnounceOwner], [AnnounceBegin], [AnnounceEnd]) VALUES (@AnnounceTitle, @AnnounceType, @AnnounceImportant, @AnnounceContent, @AnnounceOwner, @AnnounceBegin, @AnnounceEnd)";
			this._commandCollection[5].CommandType = CommandType.Text;
			this._commandCollection[5].Parameters.Add(new SqlParameter("@AnnounceTitle", SqlDbType.VarChar, 50, ParameterDirection.Input, 0, 0, "AnnounceTitle", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[5].Parameters.Add(new SqlParameter("@AnnounceType", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "AnnounceType", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[5].Parameters.Add(new SqlParameter("@AnnounceImportant", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "AnnounceImportant", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[5].Parameters.Add(new SqlParameter("@AnnounceContent", SqlDbType.Text, 2147483647, ParameterDirection.Input, 0, 0, "AnnounceContent", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[5].Parameters.Add(new SqlParameter("@AnnounceOwner", SqlDbType.VarChar, 50, ParameterDirection.Input, 0, 0, "AnnounceOwner", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[5].Parameters.Add(new SqlParameter("@AnnounceBegin", SqlDbType.DateTime, 8, ParameterDirection.Input, 0, 0, "AnnounceBegin", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[5].Parameters.Add(new SqlParameter("@AnnounceEnd", SqlDbType.DateTime, 8, ParameterDirection.Input, 0, 0, "AnnounceEnd", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[6] = new SqlCommand();
			this._commandCollection[6].Connection = this.Connection;
			this._commandCollection[6].CommandText = "UPDATE [HL_Announce] SET [AnnounceTitle] = @AnnounceTitle, [AnnounceType] = @AnnounceType, [AnnounceImportant] = @AnnounceImportant, [AnnounceContent] = @AnnounceContent, [AnnounceOwner] = @AnnounceOwner, [AnnounceBegin] = @AnnounceBegin, [AnnounceEnd] = @AnnounceEnd WHERE (([AnnounceID] = @AnnounceID))";
			this._commandCollection[6].CommandType = CommandType.Text;
			this._commandCollection[6].Parameters.Add(new SqlParameter("@AnnounceTitle", SqlDbType.VarChar, 50, ParameterDirection.Input, 0, 0, "AnnounceTitle", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[6].Parameters.Add(new SqlParameter("@AnnounceType", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "AnnounceType", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[6].Parameters.Add(new SqlParameter("@AnnounceImportant", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "AnnounceImportant", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[6].Parameters.Add(new SqlParameter("@AnnounceContent", SqlDbType.Text, 2147483647, ParameterDirection.Input, 0, 0, "AnnounceContent", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[6].Parameters.Add(new SqlParameter("@AnnounceOwner", SqlDbType.VarChar, 50, ParameterDirection.Input, 0, 0, "AnnounceOwner", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[6].Parameters.Add(new SqlParameter("@AnnounceBegin", SqlDbType.DateTime, 8, ParameterDirection.Input, 0, 0, "AnnounceBegin", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[6].Parameters.Add(new SqlParameter("@AnnounceEnd", SqlDbType.DateTime, 8, ParameterDirection.Input, 0, 0, "AnnounceEnd", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[6].Parameters.Add(new SqlParameter("@AnnounceID", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "AnnounceID", DataRowVersion.Original, false, null, "", "", ""));
		}
		[DataObjectMethod(DataObjectMethodType.Select, true), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual H_Announce.HL_AnnounceDataTable GetAnnounces()
		{
			this.Adapter.SelectCommand = this.CommandCollection[0];
			H_Announce.HL_AnnounceDataTable hL_AnnounceDataTable = new H_Announce.HL_AnnounceDataTable();
			this.Adapter.Fill(hL_AnnounceDataTable);
			return hL_AnnounceDataTable;
		}
		[DataObjectMethod(DataObjectMethodType.Select, false), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual H_Announce.HL_AnnounceDataTable GetTop10AnnouncesList()
		{
			this.Adapter.SelectCommand = this.CommandCollection[2];
			H_Announce.HL_AnnounceDataTable hL_AnnounceDataTable = new H_Announce.HL_AnnounceDataTable();
			this.Adapter.Fill(hL_AnnounceDataTable);
			return hL_AnnounceDataTable;
		}
		[DataObjectMethod(DataObjectMethodType.Select, false), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual H_Announce.HL_AnnounceDataTable GetAllAnnounces()
		{
			this.Adapter.SelectCommand = this.CommandCollection[3];
			H_Announce.HL_AnnounceDataTable hL_AnnounceDataTable = new H_Announce.HL_AnnounceDataTable();
			this.Adapter.Fill(hL_AnnounceDataTable);
			return hL_AnnounceDataTable;
		}
		[DataObjectMethod(DataObjectMethodType.Select, false), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual H_Announce.HL_AnnounceDataTable GetAnnounceByAnnounceID(int AnnounceID)
		{
			this.Adapter.SelectCommand = this.CommandCollection[4];
			this.Adapter.SelectCommand.Parameters[0].Value = AnnounceID;
			H_Announce.HL_AnnounceDataTable hL_AnnounceDataTable = new H_Announce.HL_AnnounceDataTable();
			this.Adapter.Fill(hL_AnnounceDataTable);
			return hL_AnnounceDataTable;
		}
		[HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Update(H_Announce.HL_AnnounceDataTable dataTable)
		{
			return this.Adapter.Update(dataTable);
		}
		[HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Update(H_Announce dataSet)
		{
			return this.Adapter.Update(dataSet, "HL_Announce");
		}
		[HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Update(DataRow dataRow)
		{
			return this.Adapter.Update(new DataRow[]
			{
				dataRow
			});
		}
		[HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Update(DataRow[] dataRows)
		{
			return this.Adapter.Update(dataRows);
		}
		[DataObjectMethod(DataObjectMethodType.Delete, false), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int DeleteAnnounceID(int AnnounceID)
		{
			SqlCommand sqlCommand = this.CommandCollection[1];
			sqlCommand.Parameters[0].Value = AnnounceID;
			ConnectionState state = sqlCommand.Connection.State;
			if ((sqlCommand.Connection.State & ConnectionState.Open) != ConnectionState.Open)
			{
				sqlCommand.Connection.Open();
			}
			int result;
			try
			{
				result = sqlCommand.ExecuteNonQuery();
			}
			finally
			{
				if (state == ConnectionState.Closed)
				{
					sqlCommand.Connection.Close();
				}
			}
			return result;
		}
		[DataObjectMethod(DataObjectMethodType.Insert, false), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int InsertAnnounce(string AnnounceTitle, int? AnnounceType, int? AnnounceImportant, string AnnounceContent, string AnnounceOwner, System.DateTime? AnnounceBegin, System.DateTime? AnnounceEnd)
		{
			SqlCommand sqlCommand = this.CommandCollection[5];
			if (AnnounceTitle == null)
			{
				sqlCommand.Parameters[0].Value = System.DBNull.Value;
			}
			else
			{
				sqlCommand.Parameters[0].Value = AnnounceTitle;
			}
			if (AnnounceType.HasValue)
			{
				sqlCommand.Parameters[1].Value = AnnounceType.Value;
			}
			else
			{
				sqlCommand.Parameters[1].Value = System.DBNull.Value;
			}
			if (AnnounceImportant.HasValue)
			{
				sqlCommand.Parameters[2].Value = AnnounceImportant.Value;
			}
			else
			{
				sqlCommand.Parameters[2].Value = System.DBNull.Value;
			}
			if (AnnounceContent == null)
			{
				sqlCommand.Parameters[3].Value = System.DBNull.Value;
			}
			else
			{
				sqlCommand.Parameters[3].Value = AnnounceContent;
			}
			if (AnnounceOwner == null)
			{
				sqlCommand.Parameters[4].Value = System.DBNull.Value;
			}
			else
			{
				sqlCommand.Parameters[4].Value = AnnounceOwner;
			}
			if (AnnounceBegin.HasValue)
			{
				sqlCommand.Parameters[5].Value = AnnounceBegin.Value;
			}
			else
			{
				sqlCommand.Parameters[5].Value = System.DBNull.Value;
			}
			if (AnnounceEnd.HasValue)
			{
				sqlCommand.Parameters[6].Value = AnnounceEnd.Value;
			}
			else
			{
				sqlCommand.Parameters[6].Value = System.DBNull.Value;
			}
			ConnectionState state = sqlCommand.Connection.State;
			if ((sqlCommand.Connection.State & ConnectionState.Open) != ConnectionState.Open)
			{
				sqlCommand.Connection.Open();
			}
			int result;
			try
			{
				result = sqlCommand.ExecuteNonQuery();
			}
			finally
			{
				if (state == ConnectionState.Closed)
				{
					sqlCommand.Connection.Close();
				}
			}
			return result;
		}
		[DataObjectMethod(DataObjectMethodType.Update, false), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int UpdateAnnounce(string AnnounceTitle, int? AnnounceType, int? AnnounceImportant, string AnnounceContent, string AnnounceOwner, System.DateTime? AnnounceBegin, System.DateTime? AnnounceEnd, int AnnounceID)
		{
			SqlCommand sqlCommand = this.CommandCollection[6];
			if (AnnounceTitle == null)
			{
				sqlCommand.Parameters[0].Value = System.DBNull.Value;
			}
			else
			{
				sqlCommand.Parameters[0].Value = AnnounceTitle;
			}
			if (AnnounceType.HasValue)
			{
				sqlCommand.Parameters[1].Value = AnnounceType.Value;
			}
			else
			{
				sqlCommand.Parameters[1].Value = System.DBNull.Value;
			}
			if (AnnounceImportant.HasValue)
			{
				sqlCommand.Parameters[2].Value = AnnounceImportant.Value;
			}
			else
			{
				sqlCommand.Parameters[2].Value = System.DBNull.Value;
			}
			if (AnnounceContent == null)
			{
				sqlCommand.Parameters[3].Value = System.DBNull.Value;
			}
			else
			{
				sqlCommand.Parameters[3].Value = AnnounceContent;
			}
			if (AnnounceOwner == null)
			{
				sqlCommand.Parameters[4].Value = System.DBNull.Value;
			}
			else
			{
				sqlCommand.Parameters[4].Value = AnnounceOwner;
			}
			if (AnnounceBegin.HasValue)
			{
				sqlCommand.Parameters[5].Value = AnnounceBegin.Value;
			}
			else
			{
				sqlCommand.Parameters[5].Value = System.DBNull.Value;
			}
			if (AnnounceEnd.HasValue)
			{
				sqlCommand.Parameters[6].Value = AnnounceEnd.Value;
			}
			else
			{
				sqlCommand.Parameters[6].Value = System.DBNull.Value;
			}
			sqlCommand.Parameters[7].Value = AnnounceID;
			ConnectionState state = sqlCommand.Connection.State;
			if ((sqlCommand.Connection.State & ConnectionState.Open) != ConnectionState.Open)
			{
				sqlCommand.Connection.Open();
			}
			int result;
			try
			{
				result = sqlCommand.ExecuteNonQuery();
			}
			finally
			{
				if (state == ConnectionState.Closed)
				{
					sqlCommand.Connection.Close();
				}
			}
			return result;
		}
	}
}
